;**********************************************************************************************
;Shit Builder "Code Name Sweet Dee" by eljorgejones
;
;Many thanks to Militarebear for testing and patience!
;**********************************************************************************************

variable string MYCONFIGPATH="${LavishScript.HomeDirectory}/Scripts/EQ/Config"
variable string MYUIPATH="${LavishScript.HomeDirectory}/Scripts/EQ/UI"
variable string MYSCRIPTPATH="${LavishScript.HomeDirectory}/Scripts/EQ"
variable string MYMQPATH
variable string WINDOWELEMENT=Shit Builder
variable string TABCONTROLELEMENT=expbuilder
variable string TABELEMENT=Builder
variable string TABELEMENT2=Shits Library
variable string TABELEMENT3=Options
variable string MYSET=shits
variable string ibethis
variable string cssbversion=20100307p - Alpha Preview
variable string cversion=20100401da
;***********************************************************************************************************************
;Builder Variables
;**********************************************************************************************************************

variable string cleantoon
variable string cleantoon2
variable string cleantoon3
variable int importposition
variable int importposition2
variable string importflag
variable string importflag2
variable string importshit
variable string importshit2
variable string importshit3
variable string tooninfo=NULL
variable string toon1
variable string toon2
variable string toon3
variable string toon4
variable string toon5
variable string toon6
variable string toon7
variable string toon8
variable string toon9
variable string toon10
variable string toon11
variable string toon12
variable string toon13
variable string toon14
variable string toon15
variable string toon16
variable string toon17
variable string toon18
variable string toon19
variable string toon20
variable string toon21=Library
variable string 1piece1
variable string 1piece2
variable string 1piece3
variable string 1piece4
variable string 1piece5
variable string 1piece6
variable string 2piece1
variable string 2piece2
variable string 2piece3
variable string 2piece4
variable string 2piece5
variable string 2piece6
variable string 3piece1
variable string 3piece2
variable string 3piece3
variable string 3piece4
variable string 3piece5
variable string 3piece6
variable string 4piece1
variable string 4piece2
variable string 4piece3
variable string 4piece4
variable string 4piece5
variable string 4piece6
variable string 5piece1
variable string 5piece2
variable string 5piece3
variable string 5piece4
variable string 5piece5
variable string 5piece6
variable string 6piece1
variable string 6piece2
variable string 6piece3
variable string 6piece4
variable string 6piece5
variable string 6piece6
variable string 7piece1=Empty
variable string 7piece2=Empty
variable string 7piece3=Empty
variable string 7piece4=Empty
variable string 7piece5=Empty
variable string 7piece6=Empty
variable string 8piece1
variable string 8piece2
variable string 8piece3
variable string 8piece4
variable string 8piece5
variable string 8piece6
variable string 8piece7
;***********************************************************************************************************************
;downshit/holyshit variable
;***********************************************************************************************************************

variable string downshit0=downshit0
variable string downshit1=downshit1
variable string downshit2=downshit2
variable string downshit3=downshit3
variable string downshit4=downshit4
variable string downshit5=downshit5
variable string downshit6=downshit6
variable string downshit7=downshit7
variable string downshit8=downshit8
variable string downshit9=downshit9
variable string downshit10=downshit10
variable string downshit11=downshit11
variable string downshit12=downshit12
variable string downshit13=downshit13
variable string downshit14=downshit14
variable string downshit15=downshit15
variable string downshit16=downshit16
variable string downshit17=downshit17
variable string downshit18=downshit18
variable string downshit19=downshit19
variable string downshit20=downshit20
variable string holyshit0=holyshit0
variable string holyshit1=holyshit1
variable string holyshit2=holyshit2
variable string holyshit3=holyshit3
variable string holyshit4=holyshit4
variable string holyshit5=holyshit5
variable string holyshit6=holyshit6
variable string holyshit7=holyshit7
variable string holyshit8=holyshit8
variable string holyshit9=holyshit9
variable string holyshit10=holyshit10
variable string holyshit11=holyshit11
variable string holyshit12=holyshit12
variable string holyshit13=holyshit13
variable string holyshit14=holyshit14
variable string holyshit15=holyshit15
variable string holyshit16=holyshit16
variable string holyshit17=holyshit17
variable string holyshit18=holyshit18
variable string holyshit19=holyshit19
variable string holyshit20=holyshit20

;***********************************************************************************************************************
;$ or !$ variable
;***********************************************************************************************************************

variable string truefalse1
variable string truefalse2
variable string truefalse3
variable string truefalse4
variable string truefalse5
variable string truefalse6

;***********************************************************************************************************************
;Do this variable
;***********************************************************************************************************************

variable string dothis1=/casting
variable string dothis2=/aa act
variable string dothis3=/disc
variable string dothis4=/doability

;***********************************************************************************************************************
;Percent variables
;***********************************************************************************************************************

variable string mypercent1= <95
variable string mypercent2= <90
variable string mypercent3= <85
variable string mypercent4= <80
variable string mypercent5= <75
variable string mypercent6= <70
variable string mypercent7= <65
variable string mypercent8= <60
variable string mypercent9= <55
variable string mypercent10= <50
variable string mypercent11= <45
variable string mypercent12= <40
variable string mypercent13= <35
variable string mypercent14= <30
variable string mypercent15= <25
variable string mypercent16= <20
variable string mypercent17= <15
variable string mypercent18= <10
variable string mypercent19= <5
variable string mypercent20= >5
variable string mypercent21= >10
variable string mypercent22= >15
variable string mypercent23= >20
variable string mypercent24= >25
variable string mypercent25= >30
variable string mypercent26= >35
variable string mypercent27= >40
variable string mypercent28= >45
variable string mypercent29= >50
variable string mypercent30= >55
variable string mypercent31= >60
variable string mypercent32= >65
variable string mypercent33= >70
variable string mypercent34= >75
variable string mypercent35= >80
variable string mypercent36= >85
variable string mypercent37= >90
variable string mypercent38= >95

;***********************************************************************************************************************
;Slot variables
;***********************************************************************************************************************

variable string slot1=|leftear
variable string slot2=|head
variable string slot3=|face
variable string slot4=|rightear
variable string slot5=|neck
variable string slot6=|shoulder
variable string slot7=|arms
variable string slot8=|back
variable string slot9=|leftwrist
variable string slot10=|rightwrist
variable string slot11=|ranged
variable string slot12=|hands
variable string slot13=|mainhand
variable string slot14=|offhand
variable string slot15=|leftfinger
variable string slot16=|rightfinger
variable string slot17=|chest
variable string slot18=|legs
variable string slot19=|feet
variable string slot20=|waist
variable string slot21=|alt
variable string slot22=|gem
variable string slot23=|item

;***********************************************************************************************************************
;Filler vars
;***********************************************************************************************************************

variable string lbrace=[
variable string rbrace=]
variable string lsquiggle={
variable string rsquiggle=}
variable string seperator=&&

;***********************************************************************************************************************
;Lib vars
;***********************************************************************************************************************

variable string savedshit1
variable string savedshit2
variable string savedshit3
variable string savedshit4
variable string savedshit5
variable string savedshit6
variable string savedshit7
variable string savedshit8
variable string savedshit9
variable string savedshit10
variable string savedshit11
variable string savedshit12
variable string savedshit13
variable string savedshit14
variable string savedshit15
variable string savedshit16
variable string savedshit17
variable string savedshit18
variable string savedshit19
variable string savedshit20
variable string savedshit21
variable string savedshit22
variable string savedshit23
variable string savedshit24
variable string savedshit25
variable string savedshit26
variable string savedshit27
variable string savedshit28
variable string savedshit29
variable string savedshit30
variable string savedshit31
variable string savedshit32
variable string savedshit33
variable string savedshit34
variable string savedshit35
variable string savedshit36
variable string savedshit37
variable string savedshit38
variable string savedshit39
variable string savedshit40
variable string savedshit41
variable string savedshit42
variable string savedshit43
variable string savedshit44
variable string savedshit45
variable string savedshit46
variable string savedshit47
variable string savedshit48
variable string savedshit49
variable string savedshit50
variable string tempshit
variable string tempshit2
variable string tempshit3
variable string tempshit4
variable string tempshit5
variable string tempshit6
variable string tempshit7
variable string tempshit8
variable string tempshit9
variable string tempshit10
;***********************************************************************************************************************
;config settings set holyflag
;***********************************************************************************************************************

variable settingsetref holyflag
variable settingsetref mytoon

;**********************************************************************************************************************************************
;Load UI and settings from config
;**********************************************************************************************************************************************

function main()
{
	call LoadSettings
	call LoadStarterUI
	tooninfo:Set[Library]
	do
	{
		if !${QueuedCommands}
		WaitFrame
	    else
		ExecuteQueued
	}
	while 1
}

;***********************************************************************************************************************
;Loading toon settings via LavishSettings
;***********************************************************************************************************************
function toonsettings(string imdoing)
{
variable index:string xmltoonshit

xmltoonshit:Insert[${toon1.Escape}]
xmltoonshit:Insert[${toon2.Escape}]
xmltoonshit:Insert[${toon3.Escape}]
xmltoonshit:Insert[${toon4.Escape}]
xmltoonshit:Insert[${toon5.Escape}]
xmltoonshit:Insert[${toon6.Escape}]
xmltoonshit:Insert[${toon7.Escape}]
xmltoonshit:Insert[${toon8.Escape}]
xmltoonshit:Insert[${toon9.Escape}]
xmltoonshit:Insert[${toon10.Escape}]
xmltoonshit:Insert[${toon11.Escape}]
xmltoonshit:Insert[${toon12.Escape}]
xmltoonshit:Insert[${toon13.Escape}]
xmltoonshit:Insert[${toon14.Escape}]
xmltoonshit:Insert[${toon15.Escape}]
xmltoonshit:Insert[${toon16.Escape}]
xmltoonshit:Insert[${toon17.Escape}]
xmltoonshit:Insert[${toon18.Escape}]
xmltoonshit:Insert[${toon19.Escape}]
xmltoonshit:Insert[${toon20.Escape}]
xmltoonshit:Insert[${toon21.Escape}]

echo Importing toon sets
variable int Countshit

	if ${imdoing.Equal[Create]}
	{
		holyflag:AddSet[${tooninfo}]
		mytoon:Set[${LavishSettings[${MYSET}].FindSet[holyflag].FindSet[${tooninfo}]}]

		mytoon:AddSetting[savedshit1,Empty Library Slot]
		mytoon:AddSetting[savedshit2,Empty Library Slot]
		mytoon:AddSetting[savedshit3,Empty Library Slot]
		mytoon:AddSetting[savedshit4,Empty Library Slot]
		mytoon:AddSetting[savedshit5,Empty Library Slot]
		mytoon:AddSetting[savedshit6,Empty Library Slot]
		mytoon:AddSetting[savedshit7,Empty Library Slot]
		mytoon:AddSetting[savedshit8,Empty Library Slot]
		mytoon:AddSetting[savedshit9,Empty Library Slot]
		mytoon:AddSetting[savedshit10,Empty Library Slot]
		mytoon:AddSetting[savedshit11,Empty Library Slot]
		mytoon:AddSetting[savedshit12,Empty Library Slot]
		mytoon:AddSetting[savedshit13,Empty Library Slot]
		mytoon:AddSetting[savedshit14,Empty Library Slot]
		mytoon:AddSetting[savedshit15,Empty Library Slot]
		mytoon:AddSetting[savedshit16,Empty Library Slot]
		mytoon:AddSetting[savedshit17,Empty Library Slot]
		mytoon:AddSetting[savedshit18,Empty Library Slot]
		mytoon:AddSetting[savedshit19,Empty Library Slot]
		mytoon:AddSetting[savedshit20,Empty Library Slot]
		mytoon:AddSetting[savedshit21,Empty Library Slot]
		mytoon:AddSetting[savedshit22,Empty Library Slot]
		mytoon:AddSetting[savedshit23,Empty Library Slot]
		mytoon:AddSetting[savedshit24,Empty Library Slot]
		mytoon:AddSetting[savedshit25,Empty Library Slot]
		mytoon:AddSetting[savedshit26,Empty Library Slot]
		mytoon:AddSetting[savedshit27,Empty Library Slot]
		mytoon:AddSetting[savedshit28,Empty Library Slot]
		mytoon:AddSetting[savedshit29,Empty Library Slot]
		mytoon:AddSetting[savedshit30,Empty Library Slot]
		mytoon:AddSetting[savedshit31,Empty Library Slot]
		mytoon:AddSetting[savedshit32,Empty Library Slot]
		mytoon:AddSetting[savedshit33,Empty Library Slot]
		mytoon:AddSetting[savedshit34,Empty Library Slot]
		mytoon:AddSetting[savedshit35,Empty Library Slot]
		mytoon:AddSetting[savedshit36,Empty Library Slot]
		mytoon:AddSetting[savedshit37,Empty Library Slot]
		mytoon:AddSetting[savedshit38,Empty Library Slot]
		mytoon:AddSetting[savedshit39,Empty Library Slot]
		mytoon:AddSetting[savedshit40,Empty Library Slot]
		mytoon:AddSetting[savedshit41,Empty Library Slot]
		mytoon:AddSetting[savedshit42,Empty Library Slot]
		mytoon:AddSetting[savedshit43,Empty Library Slot]
		mytoon:AddSetting[savedshit44,Empty Library Slot]
		mytoon:AddSetting[savedshit45,Empty Library Slot]
		mytoon:AddSetting[savedshit46,Empty Library Slot]
		mytoon:AddSetting[savedshit47,Empty Library Slot]
		mytoon:AddSetting[savedshit48,Empty Library Slot]
		mytoon:AddSetting[savedshit49,Empty Library Slot]
		mytoon:AddSetting[savedshit50,Empty Library Slot]
		return
	}
	if ${imdoing.Equal[Load]}
	{
		for (Countshit:Set[1] ; ${Countshit}<=21 ; Countshit:Inc)
		{
			if ${xmltoonshit[${Countshit}].Equal[Library]}
			{
				holyflag:AddSet[${xmltoonshit[${Countshit}]}]
				mytoon:Set[${LavishSettings[${MYSET}].FindSet[holyflag].FindSet[${xmltoonshit[${Countshit}]}]}]

				mytoon:AddSetting[savedshit1,Empty Library Slot]
				mytoon:AddSetting[savedshit2,Empty Library Slot]
				mytoon:AddSetting[savedshit3,Empty Library Slot]
				mytoon:AddSetting[savedshit4,Empty Library Slot]
				mytoon:AddSetting[savedshit5,Empty Library Slot]
				mytoon:AddSetting[savedshit6,Empty Library Slot]
				mytoon:AddSetting[savedshit7,Empty Library Slot]
				mytoon:AddSetting[savedshit8,Empty Library Slot]
				mytoon:AddSetting[savedshit9,Empty Library Slot]
				mytoon:AddSetting[savedshit10,Empty Library Slot]
				mytoon:AddSetting[savedshit11,Empty Library Slot]
				mytoon:AddSetting[savedshit12,Empty Library Slot]
				mytoon:AddSetting[savedshit13,Empty Library Slot]
				mytoon:AddSetting[savedshit14,Empty Library Slot]
				mytoon:AddSetting[savedshit15,Empty Library Slot]
				mytoon:AddSetting[savedshit16,Empty Library Slot]
				mytoon:AddSetting[savedshit17,Empty Library Slot]
				mytoon:AddSetting[savedshit18,Empty Library Slot]
				mytoon:AddSetting[savedshit19,Empty Library Slot]
				mytoon:AddSetting[savedshit20,Empty Library Slot]
				mytoon:AddSetting[savedshit21,Empty Library Slot]
				mytoon:AddSetting[savedshit22,Empty Library Slot]
				mytoon:AddSetting[savedshit23,Empty Library Slot]
				mytoon:AddSetting[savedshit24,Empty Library Slot]
				mytoon:AddSetting[savedshit25,Empty Library Slot]
				mytoon:AddSetting[savedshit26,Empty Library Slot]
				mytoon:AddSetting[savedshit27,Empty Library Slot]
				mytoon:AddSetting[savedshit28,Empty Library Slot]
				mytoon:AddSetting[savedshit29,Empty Library Slot]
				mytoon:AddSetting[savedshit30,Empty Library Slot]
				mytoon:AddSetting[savedshit31,Empty Library Slot]
				mytoon:AddSetting[savedshit32,Empty Library Slot]
				mytoon:AddSetting[savedshit33,Empty Library Slot]
				mytoon:AddSetting[savedshit34,Empty Library Slot]
				mytoon:AddSetting[savedshit35,Empty Library Slot]
				mytoon:AddSetting[savedshit36,Empty Library Slot]
				mytoon:AddSetting[savedshit37,Empty Library Slot]
				mytoon:AddSetting[savedshit38,Empty Library Slot]
				mytoon:AddSetting[savedshit39,Empty Library Slot]
				mytoon:AddSetting[savedshit40,Empty Library Slot]
				mytoon:AddSetting[savedshit41,Empty Library Slot]
				mytoon:AddSetting[savedshit42,Empty Library Slot]
				mytoon:AddSetting[savedshit43,Empty Library Slot]
				mytoon:AddSetting[savedshit44,Empty Library Slot]
				mytoon:AddSetting[savedshit45,Empty Library Slot]
				mytoon:AddSetting[savedshit46,Empty Library Slot]
				mytoon:AddSetting[savedshit47,Empty Library Slot]
				mytoon:AddSetting[savedshit48,Empty Library Slot]
				mytoon:AddSetting[savedshit49,Empty Library Slot]
				mytoon:AddSetting[savedshit50,Empty Library Slot]
				echo set Library
			}	
			elseif ${xmltoonshit[${Countshit}].NotEqual[NULL]}
			{
				holyflag:AddSet[${xmltoonshit[${Countshit}]}]
				mytoon:Set[${LavishSettings[${MYSET}].FindSet[holyflag].FindSet[${xmltoonshit[${Countshit}]}]}]
				echo Set ${xmltoonshit[${Countshit}]}
			}
		}
		return
	}	

	
return
}
;***********************************************************************************************************************
;Loading settings via LavishSettings
;***********************************************************************************************************************

function LoadSettings()
{
	LavishSettings:AddSet[${MYSET}]
	LavishSettings[${MYSET}]:Clear
	LavishSettings[${MYSET}]:AddSet[holyflag]
	holyflag:Set[${LavishSettings[${MYSET}].FindSet[holyflag]}]
	call toonsettings Load
	LavishSettings[${MYSET}]:Import["${MYCONFIGPATH}/holyconfig.xml"]
	
	MYMQPATH:Set[${holyflag.FindSetting[MYMQPATH,c:/program files (x86)/Macroquest2/]}]
	toon1:Set[${holyflag.FindSetting[toon1,Empty Slot]}]
	toon2:Set[${holyflag.FindSetting[toon2,Empty Slot]}]
	toon3:Set[${holyflag.FindSetting[toon3,Empty Slot]}]
	toon4:Set[${holyflag.FindSetting[toon4,Empty Slot]}]
	toon5:Set[${holyflag.FindSetting[toon5,Empty Slot]}]
	toon6:Set[${holyflag.FindSetting[toon6,Empty Slot]}]
	toon7:Set[${holyflag.FindSetting[toon7,Empty Slot]}]
	toon8:Set[${holyflag.FindSetting[toon8,Empty Slot]}]
	toon9:Set[${holyflag.FindSetting[toon9,Empty Slot]}]
	toon10:Set[${holyflag.FindSetting[toon10,Empty Slot]}]
	toon11:Set[${holyflag.FindSetting[toon11,Empty Slot]}]
	toon12:Set[${holyflag.FindSetting[toon12,Empty Slot]}]
	toon13:Set[${holyflag.FindSetting[toon13,Empty Slot]}]
	toon14:Set[${holyflag.FindSetting[toon14,Empty Slot]}]
	toon15:Set[${holyflag.FindSetting[toon15,Empty Slot]}]
	toon16:Set[${holyflag.FindSetting[toon16,Empty Slot]}]
	toon17:Set[${holyflag.FindSetting[toon17,Empty Slot]}]
	toon18:Set[${holyflag.FindSetting[toon18,Empty Slot]}]
	toon19:Set[${holyflag.FindSetting[toon19,Empty Slot]}]
	toon20:Set[${holyflag.FindSetting[toon20,Empty Slot]}]
	toon21:Set[${holyflag.FindSetting[toon21,Library]}]

return
}
;***********************************************************************************************************************
;Loading UI
;***********************************************************************************************************************
function LoadStarterUI()
{
	ui -reload "${MYUIPATH}/shitbuilder.xml"
	return
}

;***********************************************************************************************************************
;column1 iterator
;***********************************************************************************************************************

function column1(string whereigo, string row)
{
echo made it
variable index:string xmlcolumn1
variable index:string xmlcount1
xmlcolumn1:Insert[Me]
xmlcolumn1:Insert[Cast]
xmlcolumn1:Insert[Melee]
xmlcolumn1:Insert[Spell]
xmlcolumn1:Insert[Target]
xmlcolumn1:Insert[Zone]

variable int Countit

for (Countit:Set[1] ; ${Countit}<=6 ; Countit:Inc)
	{
		UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT}].FindChild[${row}].FindChild[${whereigo}]:AddItem[${xmlcolumn1[${Countit}]}]
	}
}

;***********************************************************************************************************************
;column2 iterator
;***********************************************************************************************************************

function column2(int getthis, string row)
{
variable index:string xmlframecolumn
xmlframecolumn:Insert[expstarter2a]
xmlframecolumn:Insert[expstarter2b]
xmlframecolumn:Insert[expstarter2c]
xmlframecolumn:Insert[expstarter2d]
xmlframecolumn:Insert[expstarter3a]
xmlframecolumn:Insert[expstarter3b]
xmlframecolumn:Insert[expstarter3c]
xmlframecolumn:Insert[expstarter3d]
xmlframecolumn:Insert[expstarter3e]
xmlframecolumn:Insert[expstarter4a]
xmlframecolumn:Insert[expstarter4b]
xmlframecolumn:Insert[expstarter4c]
xmlframecolumn:Insert[expstarter4d]
xmlframecolumn:Insert[2expstarter2a]
xmlframecolumn:Insert[2expstarter2b]
xmlframecolumn:Insert[2expstarter2c]
xmlframecolumn:Insert[2expstarter2d]
xmlframecolumn:Insert[2expstarter3a]
xmlframecolumn:Insert[2expstarter3b]
xmlframecolumn:Insert[2expstarter3c]
xmlframecolumn:Insert[2expstarter3d]
xmlframecolumn:Insert[2expstarter3e]
xmlframecolumn:Insert[2expstarter4a]
xmlframecolumn:Insert[2expstarter4b]
xmlframecolumn:Insert[2expstarter4c]
xmlframecolumn:Insert[2expstarter4d]
xmlframecolumn:Insert[3expstarter2a]
xmlframecolumn:Insert[3expstarter2b]
xmlframecolumn:Insert[3expstarter2c]
xmlframecolumn:Insert[3expstarter2d]
xmlframecolumn:Insert[3expstarter3a]
xmlframecolumn:Insert[3expstarter3b]
xmlframecolumn:Insert[3expstarter3c]
xmlframecolumn:Insert[3expstarter3d]
xmlframecolumn:Insert[3expstarter3e]
xmlframecolumn:Insert[3expstarter4a]
xmlframecolumn:Insert[3expstarter4b]
xmlframecolumn:Insert[3expstarter4c]
xmlframecolumn:Insert[3expstarter4d]
xmlframecolumn:Insert[4expstarter2a]
xmlframecolumn:Insert[4expstarter2b]
xmlframecolumn:Insert[4expstarter2c]
xmlframecolumn:Insert[4expstarter2d]
xmlframecolumn:Insert[4expstarter3a]
xmlframecolumn:Insert[4expstarter3b]
xmlframecolumn:Insert[4expstarter3c]
xmlframecolumn:Insert[4expstarter3d]
xmlframecolumn:Insert[4expstarter3e]
xmlframecolumn:Insert[4expstarter4a]
xmlframecolumn:Insert[4expstarter4b]
xmlframecolumn:Insert[4expstarter4c]
xmlframecolumn:Insert[4expstarter4d]
xmlframecolumn:Insert[5expstarter2a]
xmlframecolumn:Insert[5expstarter2b]
xmlframecolumn:Insert[5expstarter2c]
xmlframecolumn:Insert[5expstarter2d]
xmlframecolumn:Insert[5expstarter3a]
xmlframecolumn:Insert[5expstarter3b]
xmlframecolumn:Insert[5expstarter3c]
xmlframecolumn:Insert[5expstarter3d]
xmlframecolumn:Insert[5expstarter3e]
xmlframecolumn:Insert[5expstarter4a]
xmlframecolumn:Insert[5expstarter4b]
xmlframecolumn:Insert[5expstarter4c]
xmlframecolumn:Insert[5expstarter4d]
xmlframecolumn:Insert[6expstarter2a]
xmlframecolumn:Insert[6expstarter2b]
xmlframecolumn:Insert[6expstarter2c]
xmlframecolumn:Insert[6expstarter2d]
xmlframecolumn:Insert[6expstarter3a]
xmlframecolumn:Insert[6expstarter3b]
xmlframecolumn:Insert[6expstarter3c]
xmlframecolumn:Insert[6expstarter3d]
xmlframecolumn:Insert[6expstarter3e]
xmlframecolumn:Insert[6expstarter4a]
xmlframecolumn:Insert[6expstarter4b]
xmlframecolumn:Insert[6expstarter4c]
xmlframecolumn:Insert[6expstarter4d]

echo ${getthis}
echo ${xmlframecolumn.Get[${getthis}]}
variable int Countit

	if ${tempshit3.Equal[Me]}
	
		{
			for (Countit:Set[0] ; ${Countit}<=78 ; Countit:Inc)
			{
				UIElement[${xmlframecolumn[${Countit}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[AFK]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[AltAbilityReady]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[CombatAbilityReady]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[AbilityReady]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[CombatState]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[PctHPs]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[PctEndurance]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Buff]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[PetBuff]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Aura]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Song]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Feigning]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Sitting]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Sneaking]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Standing]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Moving]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Invis]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Casting]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[SpellReady]
		}
	if ${tempshit3.Equal[Cast]}
		{
			for (Countit:Set[0] ; ${Countit}<=78 ; Countit:Inc)
			{
				UIElement[${xmlframecolumn[${Countit}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Ready]
		}
	if ${tempshit3.Equal[Melee]}
		{
			for (Countit:Set[0] ; ${Countit}<=78 ; Countit:Inc)
			{
				UIElement[${xmlframecolumn[${Countit}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Combat]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[DiscID]
		}
	if ${tempshit3.Equal[Spell]}
		{
			for (Countit:Set[0] ; ${Countit}<=78 ; Countit:Inc)
			{
				UIElement[${xmlframecolumn[${Countit}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis:Inc}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:SetText[Enter Spell Here]
		}
	if ${tempshit3.Equal[Target]}
		{
			for (Countit:Set[0] ; ${Countit}<=78 ; Countit:Inc)
			{
				UIElement[${xmlframecolumn[${Countit}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[CleanName]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Name]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Named]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Fleeing]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[PctHPs]
		}
	if ${tempshit3.Equal[Zone]}
		{
			for (Countit:Set[0] ; ${Countit}<=78 ; Countit:Inc)
			{
				UIElement[${xmlframecolumn[${Countit}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Name]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[ID]
		}
}

;***********************************************************************************************************************
;column3 iterator
;***********************************************************************************************************************

function column3(int getthis, int starthere, int ender, string row, string endpiece)
{
variable index:string xmlframecolumn
xmlframecolumn:Insert[expstarter2a]
xmlframecolumn:Insert[expstarter2b]
xmlframecolumn:Insert[expstarter2c]
xmlframecolumn:Insert[expstarter2d]
xmlframecolumn:Insert[expstarter3a]
xmlframecolumn:Insert[expstarter3b]
xmlframecolumn:Insert[expstarter3c]
xmlframecolumn:Insert[expstarter3d]
xmlframecolumn:Insert[expstarter3e]
xmlframecolumn:Insert[expstarter4a]
xmlframecolumn:Insert[expstarter4b]
xmlframecolumn:Insert[expstarter4c]
xmlframecolumn:Insert[expstarter4d]
xmlframecolumn:Insert[2expstarter2a]
xmlframecolumn:Insert[2expstarter2b]
xmlframecolumn:Insert[2expstarter2c]
xmlframecolumn:Insert[2expstarter2d]
xmlframecolumn:Insert[2expstarter3a]
xmlframecolumn:Insert[2expstarter3b]
xmlframecolumn:Insert[2expstarter3c]
xmlframecolumn:Insert[2expstarter3d]
xmlframecolumn:Insert[2expstarter3e]
xmlframecolumn:Insert[2expstarter4a]
xmlframecolumn:Insert[2expstarter4b]
xmlframecolumn:Insert[2expstarter4c]
xmlframecolumn:Insert[2expstarter4d]
xmlframecolumn:Insert[3expstarter2a]
xmlframecolumn:Insert[3expstarter2b]
xmlframecolumn:Insert[3expstarter2c]
xmlframecolumn:Insert[3expstarter2d]
xmlframecolumn:Insert[3expstarter3a]
xmlframecolumn:Insert[3expstarter3b]
xmlframecolumn:Insert[3expstarter3c]
xmlframecolumn:Insert[3expstarter3d]
xmlframecolumn:Insert[3expstarter3e]
xmlframecolumn:Insert[3expstarter4a]
xmlframecolumn:Insert[3expstarter4b]
xmlframecolumn:Insert[3expstarter4c]
xmlframecolumn:Insert[3expstarter4d]
xmlframecolumn:Insert[4expstarter2a]
xmlframecolumn:Insert[4expstarter2b]
xmlframecolumn:Insert[4expstarter2c]
xmlframecolumn:Insert[4expstarter2d]
xmlframecolumn:Insert[4expstarter3a]
xmlframecolumn:Insert[4expstarter3b]
xmlframecolumn:Insert[4expstarter3c]
xmlframecolumn:Insert[4expstarter3d]
xmlframecolumn:Insert[4expstarter3e]
xmlframecolumn:Insert[4expstarter4a]
xmlframecolumn:Insert[4expstarter4b]
xmlframecolumn:Insert[4expstarter4c]
xmlframecolumn:Insert[4expstarter4d]
xmlframecolumn:Insert[5expstarter2a]
xmlframecolumn:Insert[5expstarter2b]
xmlframecolumn:Insert[5expstarter2c]
xmlframecolumn:Insert[5expstarter2d]
xmlframecolumn:Insert[5expstarter3a]
xmlframecolumn:Insert[5expstarter3b]
xmlframecolumn:Insert[5expstarter3c]
xmlframecolumn:Insert[5expstarter3d]
xmlframecolumn:Insert[5expstarter3e]
xmlframecolumn:Insert[5expstarter4a]
xmlframecolumn:Insert[5expstarter4b]
xmlframecolumn:Insert[5expstarter4c]
xmlframecolumn:Insert[5expstarter4d]
xmlframecolumn:Insert[6expstarter2a]
xmlframecolumn:Insert[6expstarter2b]
xmlframecolumn:Insert[6expstarter2c]
xmlframecolumn:Insert[6expstarter2d]
xmlframecolumn:Insert[6expstarter3a]
xmlframecolumn:Insert[6expstarter3b]
xmlframecolumn:Insert[6expstarter3c]
xmlframecolumn:Insert[6expstarter3d]
xmlframecolumn:Insert[6expstarter3e]
xmlframecolumn:Insert[6expstarter4a]
xmlframecolumn:Insert[6expstarter4b]
xmlframecolumn:Insert[6expstarter4c]
xmlframecolumn:Insert[6expstarter4d]
echo ${getthis} ${starthere} ${ender} ${row}
variable int CountColumn2

	if ${tempshit3.Equal[Me]}
	{
		echo ${getthis} ${starthere} ${ender} ${row}
		if ${tempshit4.Equal[AltAbilityReady]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			echo ${getthis} ${row}
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:SetText[Enter AA Here]								
		}
		if ${tempshit4.Equal[CombatAbilityReady]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}		
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:SetText[Enter Disc Here]
		}
		if ${tempshit4.Equal[AbilityReady]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:SetText[Enter Ability Here]
		}
		if ${tempshit4.Equal[CombatState]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis:Inc}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Equal]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[NotEqual]
			getthis:Dec
		}
		if ${tempshit4.Equal[PctHPs]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			getthis:Dec[3]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			call percentiterator ${xmlframecolumn.Get[${getthis}]} ${row}
			getthis:Inc[3]
		}
		if ${tempshit4.Equal[PctEndurance]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			getthis:Dec[3]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			call percentiterator ${xmlframecolumn.Get[${getthis}]} ${row}
			getthis:Inc[3]
		}
		if ${tempshit4.Equal[Buff]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:SetText[Enter Buff Here]
			echo ${UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:SetText[Enter Buff Here]}
		}
		if ${tempshit4.Equal[PetBuff]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:SetText[Enter PetBuff Here]
		}
		if ${tempshit4.Equal[SpellReady]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			getthis:Dec[2]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:SetText[Enter Spell Here]
			gettthis:Inc[2]
		}
		if ${tempshit4.Equal[Aura]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			getthis:Dec[2]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:SetText[Enter Aura Here]
			getthis:Inc[2]
		}
		if ${tempshit4.Equal[Song]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			getthis:Dec[2]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:SetText[Enter Song Here]
			getthis:Inc[2]
		}
		if ${tempshit4.Equal[Feigning]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:Show
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:SetText[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
			${endpiece}:Set[${truefalse${ender}.Escape}${lsquiggle.Escape}${tempshit3.Escape}.${tempshit4.Escape}${rsquiggle.Escape}]
		}
		if ${tempshit4.Equal[Standing]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:Show
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:SetText[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
			${endpiece}:Set[${truefalse${ender}.Escape}${lsquiggle.Escape}${tempshit3.Escape}.${tempshit4.Escape}${rsquiggle.Escape}]
		}
		if ${tempshit4.Equal[Sneaking]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:Show
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:SetText[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
			${endpiece}:Set[${truefalse${ender}.Escape}${lsquiggle.Escape}${tempshit3.Escape}.${tempshit4.Escape}${rsquiggle.Escape}]
		}
		if ${tempshit4.Equal[AFK]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:Show
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:SetText[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
			${endpiece}:Set[${truefalse${ender}.Escape}${lsquiggle.Escape}${tempshit3.Escape}.${tempshit4.Escape}${rsquiggle.Escape}]
		}		
		if ${tempshit4.Equal[Moving]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:Show
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:SetText[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
			${endpiece}:Set[${truefalse${ender}.Escape}${lsquiggle.Escape}${tempshit3.Escape}.${tempshit4.Escape}${rsquiggle.Escape}]
		}
		if ${tempshit4.Equal[Sitting]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:Show
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:SetText[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
			${endpiece}:Set[${truefalse${ender}.Escape}${lsquiggle.Escape}${tempshit3.Escape}.${tempshit4.Escape}${rsquiggle.Escape}]
		}
		if ${tempshit4.Equal[Invis]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:Show
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:SetText[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
			${endpiece}:Set[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
		}
		if ${tempshit4.Equal[Casting]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:Show
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:SetText[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
			${endpiece}:Set[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
		}
	}
	if ${tempshit3.Equal[Cast]}
	{
		if ${tempshit4.Equal[Ready]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			getthis:Dec
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:SetText[Enter Item Here]
			getthis:Inc
		}
	}
	if ${tempshit3.Equal[Melee]}
	{
		if ${tempshit4.Equal[Combat]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:Show
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:SetText[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
			${endpiece}:Set[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
		}
		if ${tempshit4.Equal[DiscID]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:Show
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:SetText[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
			${endpiece}:Set[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
		}
	}
	if ${tempshit3.Equal[Target]}
	{
		if ${tempshit4.Equal[Fleeing]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:Show
			UIElement[expender${ender}@enders@Builder@expbuilder@Shit Builder]:SetText[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
			${endpiece}:Set[${truefalse${ender}}${lsquiggle.Escape}${tempshit3}.${tempshit4}${rsquiggle.Escape}]
		}
		if ${tempshit4.Equal[CleanName]}
		{
		for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis:Inc}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Equal]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[NotEqual]
			getthis:Dec
		}
		if ${tempshit4.Equal[Name]}
		{
		for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis:Inc}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			echo ${UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show}
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Equal]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[NotEqual]
			getthis:Dec
		}
		if ${tempshit4.Equal[Named]}
		{
		for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis:Inc}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Equal]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[NotEqual]
			getthis:Dec
		}
		if ${tempshit4.Equal[PctHPs]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			getthis:Dec[3]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			call percentiterator ${xmlframecolumn.Get[${getthis}]} ${row}
			getthis:Inc[3]
		}
	}
	if ${tempshit3.Equal[Zone]}
	{
		if ${tempshit4.Equal[ID]}
		{
			for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			getthis:Inc
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[==]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[!=]
			getthis:Dec
		}
		if ${tempshit4.Equal[Name]}
		{
		for (CountColumn2:Set[${starthere}] ; ${CountColumn2}<=78 ; CountColumn2:Inc)
			{
				UIElement[${xmlframecolumn[${CountColumn2}]}@${row}@Builder@expbuilder@Shit Builder]:Hide
			}
			UIElement[${xmlframecolumn.Get[${getthis:Inc}]}@${row}@Builder@expbuilder@Shit Builder]:ClearItems
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:Show
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[Equal]
			UIElement[${xmlframecolumn.Get[${getthis}]}@${row}@Builder@expbuilder@Shit Builder]:AddItem[NotEqual]
			getthis:Dec
		}
	}
}

;***********************************************************************************************************************
;Percent iterator
;***********************************************************************************************************************

function percentiterator(string whereigo, string row)
{
variable index:string xmlmypercent
xmlmypercent:Insert[${mypercent1}]
xmlmypercent:Insert[${mypercent2}]
xmlmypercent:Insert[${mypercent3}]
xmlmypercent:Insert[${mypercent4}]
xmlmypercent:Insert[${mypercent5}]
xmlmypercent:Insert[${mypercent6}]
xmlmypercent:Insert[${mypercent7}]
xmlmypercent:Insert[${mypercent8}]
xmlmypercent:Insert[${mypercent9}]
xmlmypercent:Insert[${mypercent10}]
xmlmypercent:Insert[${mypercent11}]
xmlmypercent:Insert[${mypercent12}]
xmlmypercent:Insert[${mypercent13}]
xmlmypercent:Insert[${mypercent14}]
xmlmypercent:Insert[${mypercent15}]
xmlmypercent:Insert[${mypercent16}]
xmlmypercent:Insert[${mypercent17}]
xmlmypercent:Insert[${mypercent18}]
xmlmypercent:Insert[${mypercent19}]
xmlmypercent:Insert[${mypercent20}]
xmlmypercent:Insert[${mypercent21}]
xmlmypercent:Insert[${mypercent22}]
xmlmypercent:Insert[${mypercent23}]
xmlmypercent:Insert[${mypercent24}]
xmlmypercent:Insert[${mypercent25}]
xmlmypercent:Insert[${mypercent26}]
xmlmypercent:Insert[${mypercent27}]
xmlmypercent:Insert[${mypercent28}]
xmlmypercent:Insert[${mypercent29}]
xmlmypercent:Insert[${mypercent30}]
xmlmypercent:Insert[${mypercent31}]
xmlmypercent:Insert[${mypercent32}]
xmlmypercent:Insert[${mypercent33}]
xmlmypercent:Insert[${mypercent34}]
xmlmypercent:Insert[${mypercent35}]
xmlmypercent:Insert[${mypercent36}]
xmlmypercent:Insert[${mypercent37}]
xmlmypercent:Insert[${mypercent38}]

variable int Countpercent

for (Countpercent:Set[1] ; ${Countpercent}<=38 ; Countpercent:Inc)
	{
		UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT}].FindChild[${row}].FindChild[${whereigo}]:AddItem[${xmlmypercent[${Countpercent}]}]
	}
}

;***********************************************************************************************************************
;Slot iterator
;***********************************************************************************************************************

function slotiterator()
{

variable index:string xmlslot
xmlslot:Insert[${slot1}]
xmlslot:Insert[${slot2}]
xmlslot:Insert[${slot3}]
xmlslot:Insert[${slot4}]
xmlslot:Insert[${slot5}]
xmlslot:Insert[${slot6}]
xmlslot:Insert[${slot7}]
xmlslot:Insert[${slot8}]
xmlslot:Insert[${slot9}]
xmlslot:Insert[${slot10}]
xmlslot:Insert[${slot11}]
xmlslot:Insert[${slot12}]
xmlslot:Insert[${slot13}]
xmlslot:Insert[${slot14}]
xmlslot:Insert[${slot15}]
xmlslot:Insert[${slot16}]
xmlslot:Insert[${slot17}]
xmlslot:Insert[${slot18}]
xmlslot:Insert[${slot19}]
xmlslot:Insert[${slot20}]
xmlslot:Insert[${slot21}]
xmlslot:Insert[${slot22}]
xmlslot:Insert[${slot23}]

variable int Countslot

for (Countslot:Set[1] ; ${Countslot}<=23 ; Countslot:Inc)
	{
		UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT}].FindChild[actionrow].FindChild[expslot]:AddItem[${xmlslot[${Countslot}]}]
	}
}

;***********************************************************************************************************************
;Shit iterator
;***********************************************************************************************************************

function shititerator(string frame)
{
variable index:string xmlshit
xmlshit:Insert[${downshit0}]
xmlshit:Insert[${downshit1}]
xmlshit:Insert[${downshit2}]
xmlshit:Insert[${downshit3}]
xmlshit:Insert[${downshit4}]
xmlshit:Insert[${downshit5}]
xmlshit:Insert[${downshit6}]
xmlshit:Insert[${downshit7}]
xmlshit:Insert[${downshit8}]
xmlshit:Insert[${downshit9}]
xmlshit:Insert[${downshit10}]
xmlshit:Insert[${downshit11}]
xmlshit:Insert[${downshit12}]
xmlshit:Insert[${downshit13}]
xmlshit:Insert[${downshit14}]
xmlshit:Insert[${downshit15}]
xmlshit:Insert[${downshit16}]
xmlshit:Insert[${downshit17}]
xmlshit:Insert[${downshit18}]
xmlshit:Insert[${downshit19}]
xmlshit:Insert[${downshit20}]
xmlshit:Insert[${holyshit0}]
xmlshit:Insert[${holyshit1}]
xmlshit:Insert[${holyshit2}]
xmlshit:Insert[${holyshit3}]
xmlshit:Insert[${holyshit4}]
xmlshit:Insert[${holyshit5}]
xmlshit:Insert[${holyshit6}]
xmlshit:Insert[${holyshit7}]
xmlshit:Insert[${holyshit8}]
xmlshit:Insert[${holyshit9}]
xmlshit:Insert[${holyshit10}]
xmlshit:Insert[${holyshit11}]
xmlshit:Insert[${holyshit12}]
xmlshit:Insert[${holyshit13}]
xmlshit:Insert[${holyshit14}]
xmlshit:Insert[${holyshit15}]
xmlshit:Insert[${holyshit16}]
xmlshit:Insert[${holyshit17}]
xmlshit:Insert[${holyshit18}]
xmlshit:Insert[${holyshit19}]
xmlshit:Insert[${holyshit20}]

variable int Countshit

for (Countshit:Set[1] ; ${Countshit}<=40 ; Countshit:Inc)
	{
		if ${frame.Equal[main]}
		{
			UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT}].FindChild[actionrow].FindChild[expshit]:AddItem[${xmlshit[${Countshit}]}]
		}
		elseif ${frame.Equal[lib]}
		{
			UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT2}].FindChild[libactionrow].FindChild[libexpshit]:AddItem[${xmlshit[${Countshit}]}]
		}
	}
}

;***********************************************************************************************************************
;Flag iterator
;***********************************************************************************************************************

function flagiterator(string frame)
{
variable index:string xmlflag
xmlflag:Insert[downflag0]
xmlflag:Insert[downflag1]
xmlflag:Insert[downflag2]
xmlflag:Insert[downflag3]
xmlflag:Insert[downflag4]
xmlflag:Insert[downflag5]
xmlflag:Insert[downflag6]
xmlflag:Insert[downflag7]
xmlflag:Insert[downflag8]
xmlflag:Insert[downflag9]
xmlflag:Insert[downflag10]
xmlflag:Insert[downflag11]
xmlflag:Insert[downflag12]
xmlflag:Insert[downflag13]
xmlflag:Insert[downflag14]
xmlflag:Insert[downflag15]
xmlflag:Insert[downflag16]
xmlflag:Insert[downflag17]
xmlflag:Insert[downflag18]
xmlflag:Insert[downflag19]
xmlflag:Insert[downflag20]
xmlflag:Insert[holyflag0]
xmlflag:Insert[holyflag1]
xmlflag:Insert[holyflag2]
xmlflag:Insert[holyflag3]
xmlflag:Insert[holyflag4]
xmlflag:Insert[holyflag5]
xmlflag:Insert[holyflag6]
xmlflag:Insert[holyflag7]
xmlflag:Insert[holyflag8]
xmlflag:Insert[holyflag9]
xmlflag:Insert[holyflag10]
xmlflag:Insert[holyflag11]
xmlflag:Insert[holyflag12]
xmlflag:Insert[holyflag13]
xmlflag:Insert[holyflag14]
xmlflag:Insert[holyflag15]
xmlflag:Insert[holyflag16]
xmlflag:Insert[holyflag17]
xmlflag:Insert[holyflag18]
xmlflag:Insert[holyflag19]
xmlflag:Insert[holyflag20]

variable int Countshit

for (Countshit:Set[1] ; ${Countshit}<=40 ; Countshit:Inc)
	{
		if ${frame.Equal[main]}
		{
			UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT}].FindChild[actionrow].FindChild[expflag]:AddItem[${xmlflag[${Countshit}]}]
		}
		elseif ${frame.Equal[lib]}
		{
			UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT2}].FindChild[libactionrow].FindChild[libexpflag]:AddItem[${xmlflag[${Countshit}]}]
		}
	}
}
;***********************************************************************************************************************
;Save Shits settings
;***********************************************************************************************************************

function saveshit()
{
variable index:string xmlsaveshit
variable index:string xmlsaveshit2
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit1]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit2]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit3]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit4]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit5]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit6]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit7]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit8]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit9]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit10]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit11]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit12]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit13]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit14]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit15]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit16]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit17]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit18]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit19]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit20]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit21]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit22]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit23]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit24]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit25]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit26]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit27]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit28]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit29]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit30]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit31]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit32]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit33]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit34]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit35]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit36]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit37]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit38]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit39]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit40]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit41]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit42]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit43]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit44]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit45]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit46]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit47]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit48]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit49]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit50]}]
xmlsaveshit2:Insert[savedshit1]
xmlsaveshit2:Insert[savedshit2]
xmlsaveshit2:Insert[savedshit3]
xmlsaveshit2:Insert[savedshit4]
xmlsaveshit2:Insert[savedshit5]
xmlsaveshit2:Insert[savedshit6]
xmlsaveshit2:Insert[savedshit7]
xmlsaveshit2:Insert[savedshit8]
xmlsaveshit2:Insert[savedshit9]
xmlsaveshit2:Insert[savedshit10]
xmlsaveshit2:Insert[savedshit11]
xmlsaveshit2:Insert[savedshit12]
xmlsaveshit2:Insert[savedshit13]
xmlsaveshit2:Insert[savedshit14]
xmlsaveshit2:Insert[savedshit15]
xmlsaveshit2:Insert[savedshit16]
xmlsaveshit2:Insert[savedshit17]
xmlsaveshit2:Insert[savedshit18]
xmlsaveshit2:Insert[savedshit19]
xmlsaveshit2:Insert[savedshit20]
xmlsaveshit2:Insert[savedshit21]
xmlsaveshit2:Insert[savedshit22]
xmlsaveshit2:Insert[savedshit23]
xmlsaveshit2:Insert[savedshit24]
xmlsaveshit2:Insert[savedshit25]
xmlsaveshit2:Insert[savedshit26]
xmlsaveshit2:Insert[savedshit27]
xmlsaveshit2:Insert[savedshit28]
xmlsaveshit2:Insert[savedshit29]
xmlsaveshit2:Insert[savedshit30]
xmlsaveshit2:Insert[savedshit31]
xmlsaveshit2:Insert[savedshit32]
xmlsaveshit2:Insert[savedshit33]
xmlsaveshit2:Insert[savedshit34]
xmlsaveshit2:Insert[savedshit35]
xmlsaveshit2:Insert[savedshit36]
xmlsaveshit2:Insert[savedshit37]
xmlsaveshit2:Insert[savedshit38]
xmlsaveshit2:Insert[savedshit39]
xmlsaveshit2:Insert[savedshit40]
xmlsaveshit2:Insert[savedshit41]
xmlsaveshit2:Insert[savedshit42]
xmlsaveshit2:Insert[savedshit43]
xmlsaveshit2:Insert[savedshit44]
xmlsaveshit2:Insert[savedshit45]
xmlsaveshit2:Insert[savedshit46]
xmlsaveshit2:Insert[savedshit47]
xmlsaveshit2:Insert[savedshit48]
xmlsaveshit2:Insert[savedshit49]
xmlsaveshit2:Insert[savedshit50]
variable int Countshit

echo libsetting: mytoon.FindSetting[savedshit1]
echo indexsetting: ${xmlsaveshit}
for (Countshit:Set[0] ; ${Countshit}<=50 ; Countshit:Inc)
	{
		if ${xmlsaveshit[${Countshit}].Equal[Empty Library Slot]}
		{
			mytoon.FindSetting[${xmlsaveshit2[${Countshit}]}]:Set[${tempshit8.Escape}]
			echo tempshit8: ${tempshit8.Escape}
			echo indexsetting2: ${xmlsaveshit[${Countshit}]}
			UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT2}].FindChild[xmlshitlist]:AddItem[${tempshit8.Escape}]
			LavishSettings[${MYSET}]:Export["${MYCONFIGPATH}/holyconfig.xml"]
			call LoadSettings
			call removeshitlist
			call shitlist
			break
		}
	}
}

;***********************************************************************************************************************
;Save Copied Shits settings
;***********************************************************************************************************************

function copyshit()
{
variable index:string xmlsaveshit
variable index:string xmlsaveshit2
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit1]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit2]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit3]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit4]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit5]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit6]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit7]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit8]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit9]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit10]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit11]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit12]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit13]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit14]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit15]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit16]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit17]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit18]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit19]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit20]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit21]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit22]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit23]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit24]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit25]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit26]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit27]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit28]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit29]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit30]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit31]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit32]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit33]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit34]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit35]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit36]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit37]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit38]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit39]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit40]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit41]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit42]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit43]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit44]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit45]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit46]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit47]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit48]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit49]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit50]}]
xmlsaveshit2:Insert[savedshit1]
xmlsaveshit2:Insert[savedshit2]
xmlsaveshit2:Insert[savedshit3]
xmlsaveshit2:Insert[savedshit4]
xmlsaveshit2:Insert[savedshit5]
xmlsaveshit2:Insert[savedshit6]
xmlsaveshit2:Insert[savedshit7]
xmlsaveshit2:Insert[savedshit8]
xmlsaveshit2:Insert[savedshit9]
xmlsaveshit2:Insert[savedshit10]
xmlsaveshit2:Insert[savedshit11]
xmlsaveshit2:Insert[savedshit12]
xmlsaveshit2:Insert[savedshit13]
xmlsaveshit2:Insert[savedshit14]
xmlsaveshit2:Insert[savedshit15]
xmlsaveshit2:Insert[savedshit16]
xmlsaveshit2:Insert[savedshit17]
xmlsaveshit2:Insert[savedshit18]
xmlsaveshit2:Insert[savedshit19]
xmlsaveshit2:Insert[savedshit20]
xmlsaveshit2:Insert[savedshit21]
xmlsaveshit2:Insert[savedshit22]
xmlsaveshit2:Insert[savedshit23]
xmlsaveshit2:Insert[savedshit24]
xmlsaveshit2:Insert[savedshit25]
xmlsaveshit2:Insert[savedshit26]
xmlsaveshit2:Insert[savedshit27]
xmlsaveshit2:Insert[savedshit28]
xmlsaveshit2:Insert[savedshit29]
xmlsaveshit2:Insert[savedshit30]
xmlsaveshit2:Insert[savedshit31]
xmlsaveshit2:Insert[savedshit32]
xmlsaveshit2:Insert[savedshit33]
xmlsaveshit2:Insert[savedshit34]
xmlsaveshit2:Insert[savedshit35]
xmlsaveshit2:Insert[savedshit36]
xmlsaveshit2:Insert[savedshit37]
xmlsaveshit2:Insert[savedshit38]
xmlsaveshit2:Insert[savedshit39]
xmlsaveshit2:Insert[savedshit40]
xmlsaveshit2:Insert[savedshit41]
xmlsaveshit2:Insert[savedshit42]
xmlsaveshit2:Insert[savedshit43]
xmlsaveshit2:Insert[savedshit44]
xmlsaveshit2:Insert[savedshit45]
xmlsaveshit2:Insert[savedshit46]
xmlsaveshit2:Insert[savedshit47]
xmlsaveshit2:Insert[savedshit48]
xmlsaveshit2:Insert[savedshit49]
xmlsaveshit2:Insert[savedshit50]

variable int Countshit

for (Countshit:Set[0] ; ${Countshit}<=50 ; Countshit:Inc)
	{
		if ${xmlsaveshit[${Countshit}].Equal[Empty Library Slot]}
		{
			mytoon.FindSetting[${xmlsaveshit2[${Countshit}]}]:Set[${tempshit8.Escape}]
			LavishSettings[${MYSET}]:Export["${MYCONFIGPATH}/holyconfig.xml"]
			echo DIDIT
			echo ${tooninfo}
			echo ${mytoon.FindSetting[${xmlsaveshit2[${Countshit}]}]}
			call LoadSettings
			break
		}
	}
}

;***********************************************************************************************************************
;Set tooninfo for lavishsettings
;***********************************************************************************************************************
function settoon()
{
	echo toonselect: ${tooninfo}
	mytoon:Set[${LavishSettings[${MYSET}].FindSet[holyflag].FindSet[${tooninfo}]}]
}
;***********************************************************************************************************************
;Add Shits to Listbox
;***********************************************************************************************************************

function shitlist()
{
variable index:string xmlsaveshit
xmlsaveshit:Insert[savedshit1]
xmlsaveshit:Insert[savedshit2]
xmlsaveshit:Insert[savedshit3]
xmlsaveshit:Insert[savedshit4]
xmlsaveshit:Insert[savedshit5]
xmlsaveshit:Insert[savedshit6]
xmlsaveshit:Insert[savedshit7]
xmlsaveshit:Insert[savedshit8]
xmlsaveshit:Insert[savedshit9]
xmlsaveshit:Insert[savedshit10]
xmlsaveshit:Insert[savedshit11]
xmlsaveshit:Insert[savedshit12]
xmlsaveshit:Insert[savedshit13]
xmlsaveshit:Insert[savedshit14]
xmlsaveshit:Insert[savedshit15]
xmlsaveshit:Insert[savedshit16]
xmlsaveshit:Insert[savedshit17]
xmlsaveshit:Insert[savedshit18]
xmlsaveshit:Insert[savedshit19]
xmlsaveshit:Insert[savedshit20]
xmlsaveshit:Insert[savedshit21]
xmlsaveshit:Insert[savedshit22]
xmlsaveshit:Insert[savedshit23]
xmlsaveshit:Insert[savedshit24]
xmlsaveshit:Insert[savedshit25]
xmlsaveshit:Insert[savedshit26]
xmlsaveshit:Insert[savedshit27]
xmlsaveshit:Insert[savedshit28]
xmlsaveshit:Insert[savedshit29]
xmlsaveshit:Insert[savedshit30]
xmlsaveshit:Insert[savedshit31]
xmlsaveshit:Insert[savedshit32]
xmlsaveshit:Insert[savedshit33]
xmlsaveshit:Insert[savedshit34]
xmlsaveshit:Insert[savedshit35]
xmlsaveshit:Insert[savedshit36]
xmlsaveshit:Insert[savedshit37]
xmlsaveshit:Insert[savedshit38]
xmlsaveshit:Insert[savedshit39]
xmlsaveshit:Insert[savedshit40]
xmlsaveshit:Insert[savedshit41]
xmlsaveshit:Insert[savedshit42]
xmlsaveshit:Insert[savedshit43]
xmlsaveshit:Insert[savedshit44]
xmlsaveshit:Insert[savedshit45]
xmlsaveshit:Insert[savedshit46]
xmlsaveshit:Insert[savedshit47]
xmlsaveshit:Insert[savedshit48]
xmlsaveshit:Insert[savedshit49]
xmlsaveshit:Insert[savedshit50]

variable int Countshit

for (Countshit:Set[1] ; ${Countshit}<=50 ; Countshit:Inc)
	{
		mytoon:Set[${LavishSettings[${MYSET}].FindSet[holyflag].FindSet[${tooninfo}]}]
		UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT2}].FindChild[xmlshitlist]:AddItem[${mytoon.FindSetting[${xmlsaveshit[${Countshit}]}].String.Escape},${xmlsaveshit[${Countshit}]}]
	}
return
}

;***********************************************************************************************************************
;Clear Shits from library for refresh
;***********************************************************************************************************************

function removeshitlist()
{
	UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT2}].FindChild[xmlshitlist]:ClearItems
	return
}

;***********************************************************************************************************************
;Delete Shits from library
;***********************************************************************************************************************

function deleteshit()
{
variable index:string xmlsaveshit
xmlsaveshit:Insert[savedshit1]
xmlsaveshit:Insert[savedshit2]
xmlsaveshit:Insert[savedshit3]
xmlsaveshit:Insert[savedshit4]
xmlsaveshit:Insert[savedshit5]
xmlsaveshit:Insert[savedshit6]
xmlsaveshit:Insert[savedshit7]
xmlsaveshit:Insert[savedshit8]
xmlsaveshit:Insert[savedshit9]
xmlsaveshit:Insert[savedshit10]
xmlsaveshit:Insert[savedshit11]
xmlsaveshit:Insert[savedshit12]
xmlsaveshit:Insert[savedshit13]
xmlsaveshit:Insert[savedshit14]
xmlsaveshit:Insert[savedshit15]
xmlsaveshit:Insert[savedshit16]
xmlsaveshit:Insert[savedshit17]
xmlsaveshit:Insert[savedshit18]
xmlsaveshit:Insert[savedshit19]
xmlsaveshit:Insert[savedshit20]
xmlsaveshit:Insert[savedshit21]
xmlsaveshit:Insert[savedshit22]
xmlsaveshit:Insert[savedshit23]
xmlsaveshit:Insert[savedshit24]
xmlsaveshit:Insert[savedshit25]
xmlsaveshit:Insert[savedshit26]
xmlsaveshit:Insert[savedshit27]
xmlsaveshit:Insert[savedshit28]
xmlsaveshit:Insert[savedshit29]
xmlsaveshit:Insert[savedshit30]
xmlsaveshit:Insert[savedshit31]
xmlsaveshit:Insert[savedshit32]
xmlsaveshit:Insert[savedshit33]
xmlsaveshit:Insert[savedshit34]
xmlsaveshit:Insert[savedshit35]
xmlsaveshit:Insert[savedshit36]
xmlsaveshit:Insert[savedshit37]
xmlsaveshit:Insert[savedshit38]
xmlsaveshit:Insert[savedshit39]
xmlsaveshit:Insert[savedshit40]
xmlsaveshit:Insert[savedshit41]
xmlsaveshit:Insert[savedshit42]
xmlsaveshit:Insert[savedshit43]
xmlsaveshit:Insert[savedshit44]
xmlsaveshit:Insert[savedshit45]
xmlsaveshit:Insert[savedshit46]
xmlsaveshit:Insert[savedshit47]
xmlsaveshit:Insert[savedshit48]
xmlsaveshit:Insert[savedshit49]
xmlsaveshit:Insert[savedshit50]

	LavishSettings[${MYSET}]:Export["${MYCONFIGPATH}/holyconfig.xml"]
	mytoon:Set[${LavishSettings[${MYSET}].FindSet[holyflag].FindSet[${tooninfo}]}]
	mytoon.FindSetting[${xmlsaveshit.Get[${tempshit2}]}]:Set[Empty Library Slot]
	call export
	call LoadSettings
	call removeshitlist
	call shitlist
}

;***********************************************************************************************************************
;Purge shitlist on reimport
;***********************************************************************************************************************

function purgeshit()
{
variable index:string xmlsaveshit
xmlsaveshit:Insert[savedshit1]
xmlsaveshit:Insert[savedshit2]
xmlsaveshit:Insert[savedshit3]
xmlsaveshit:Insert[savedshit4]
xmlsaveshit:Insert[savedshit5]
xmlsaveshit:Insert[savedshit6]
xmlsaveshit:Insert[savedshit7]
xmlsaveshit:Insert[savedshit8]
xmlsaveshit:Insert[savedshit9]
xmlsaveshit:Insert[savedshit10]
xmlsaveshit:Insert[savedshit11]
xmlsaveshit:Insert[savedshit12]
xmlsaveshit:Insert[savedshit13]
xmlsaveshit:Insert[savedshit14]
xmlsaveshit:Insert[savedshit15]
xmlsaveshit:Insert[savedshit16]
xmlsaveshit:Insert[savedshit17]
xmlsaveshit:Insert[savedshit18]
xmlsaveshit:Insert[savedshit19]
xmlsaveshit:Insert[savedshit20]
xmlsaveshit:Insert[savedshit21]
xmlsaveshit:Insert[savedshit22]
xmlsaveshit:Insert[savedshit23]
xmlsaveshit:Insert[savedshit24]
xmlsaveshit:Insert[savedshit25]
xmlsaveshit:Insert[savedshit26]
xmlsaveshit:Insert[savedshit27]
xmlsaveshit:Insert[savedshit28]
xmlsaveshit:Insert[savedshit29]
xmlsaveshit:Insert[savedshit30]
xmlsaveshit:Insert[savedshit31]
xmlsaveshit:Insert[savedshit32]
xmlsaveshit:Insert[savedshit33]
xmlsaveshit:Insert[savedshit34]
xmlsaveshit:Insert[savedshit35]
xmlsaveshit:Insert[savedshit36]
xmlsaveshit:Insert[savedshit37]
xmlsaveshit:Insert[savedshit38]
xmlsaveshit:Insert[savedshit39]
xmlsaveshit:Insert[savedshit40]
xmlsaveshit:Insert[savedshit41]
xmlsaveshit:Insert[savedshit42]
xmlsaveshit:Insert[savedshit43]
xmlsaveshit:Insert[savedshit44]
xmlsaveshit:Insert[savedshit45]
xmlsaveshit:Insert[savedshit46]
xmlsaveshit:Insert[savedshit47]
xmlsaveshit:Insert[savedshit48]
xmlsaveshit:Insert[savedshit49]
xmlsaveshit:Insert[savedshit50]

variable int Countshit

for (Countshit:Set[1] ; ${Countshit}<=50 ; Countshit:Inc)
	{
		mytoon:Set[${LavishSettings[${MYSET}].FindSet[holyflag].FindSet[${tooninfo}]}]
		mytoon.FindSetting[${xmlsaveshit[${Countshit}]}]:Set[Empty Library Slot]
	}
	LavishSettings[${MYSET}]:Export["${MYCONFIGPATH}/holyconfig.xml"]
	call LoadSettings
	return
}

;***********************************************************************************************************************
;Save toon ini settings
;***********************************************************************************************************************

function savetoon()
{
variable index:string xmltoon
variable index:string xmltoon2
xmltoon:Insert[${toon21.Escape}]
xmltoon:Insert[${toon1.Escape}]
xmltoon:Insert[${toon2.Escape}]
xmltoon:Insert[${toon3.Escape}]
xmltoon:Insert[${toon4.Escape}]
xmltoon:Insert[${toon5.Escape}]
xmltoon:Insert[${toon6.Escape}]
xmltoon:Insert[${toon7.Escape}]
xmltoon:Insert[${toon8.Escape}]
xmltoon:Insert[${toon9.Escape}]
xmltoon:Insert[${toon10.Escape}]
xmltoon:Insert[${toon11.Escape}]
xmltoon:Insert[${toon12.Escape}]
xmltoon:Insert[${toon13.Escape}]
xmltoon:Insert[${toon14.Escape}]
xmltoon:Insert[${toon15.Escape}]
xmltoon:Insert[${toon16.Escape}]
xmltoon:Insert[${toon17.Escape}]
xmltoon:Insert[${toon18.Escape}]
xmltoon:Insert[${toon19.Escape}]
xmltoon:Insert[${toon20.Escape}]
xmltoon2:Insert[toon21]
xmltoon2:Insert[toon1]
xmltoon2:Insert[toon2]
xmltoon2:Insert[toon3]
xmltoon2:Insert[toon4]
xmltoon2:Insert[toon5]
xmltoon2:Insert[toon6]
xmltoon2:Insert[toon7]
xmltoon2:Insert[toon8]
xmltoon2:Insert[toon9]
xmltoon2:Insert[toon10]
xmltoon2:Insert[toon11]
xmltoon2:Insert[toon12]
xmltoon2:Insert[toon13]
xmltoon2:Insert[toon14]
xmltoon2:Insert[toon15]
xmltoon2:Insert[toon16]
xmltoon2:Insert[toon17]
xmltoon2:Insert[toon18]
xmltoon2:Insert[toon19]
xmltoon2:Insert[toon20]
variable int Counttoon

for (Counttoon:Set[0] ; ${Counttoon}<=21 ; Counttoon:Inc)
	{
		if ${xmltoon[${Counttoon}].Equal[Empty Slot]}
		{
			holyflag.FindSetting[${xmltoon2[${Counttoon}]}]:Set[${tempshit.Escape}]
			UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT3}].FindChild[options1].FindChild[toons]:AddItem[${tempshit.Escape}]
			LavishSettings[${MYSET}]:Export["${MYCONFIGPATH}/holyconfig.xml"]
			call export
			call LoadSettings
			call removetoon
			call toonlist
			break
		}
	}
}

;***********************************************************************************************************************
;Delete toon from library
;***********************************************************************************************************************

function deletetoon()
{
variable index:string xmltoon
xmltoon:Insert[toon21]
xmltoon:Insert[toon1]
xmltoon:Insert[toon2]
xmltoon:Insert[toon3]
xmltoon:Insert[toon4]
xmltoon:Insert[toon5]
xmltoon:Insert[toon6]
xmltoon:Insert[toon7]
xmltoon:Insert[toon8]
xmltoon:Insert[toon9]
xmltoon:Insert[toon10]
xmltoon:Insert[toon11]
xmltoon:Insert[toon12]
xmltoon:Insert[toon13]
xmltoon:Insert[toon14]
xmltoon:Insert[toon15]
xmltoon:Insert[toon16]
xmltoon:Insert[toon17]
xmltoon:Insert[toon18]
xmltoon:Insert[toon19]
xmltoon:Insert[toon20]
echo ${tempshit}
echo ${tempshit2}
	LavishSettings[${MYSET}]:Export["${MYCONFIGPATH}/holyconfig.xml"]
	holyflag.FindSetting[${xmltoon.Get[${tempshit2}]}]:Set[Empty Slot]
	call export
	call LoadSettings
	call removetoon
	call toonlist
}

;***********************************************************************************************************************
;Clear toons from library for refresh
;***********************************************************************************************************************

function removetoon()
{
	UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT3}].FindChild[options1].FindChild[toons]:ClearItems
	UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT3}].FindChild[options3].FindChild[importtoons]:ClearItems
	UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT2}].FindChild[libfinaltoons]:ClearItems
	UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT}].FindChild[final].FindChild[expfinaltoons]:ClearItems
	UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT2}].FindChild[libfinalrow].FindChild[libcopytoons]:ClearItems
	return
}

;***********************************************************************************************************************
;Add toons to Listbox
;***********************************************************************************************************************

function toonlist()
{
variable index:string xmltoon
xmltoon:Insert[toon21]
xmltoon:Insert[toon1]
xmltoon:Insert[toon2]
xmltoon:Insert[toon3]
xmltoon:Insert[toon4]
xmltoon:Insert[toon5]
xmltoon:Insert[toon6]
xmltoon:Insert[toon7]
xmltoon:Insert[toon8]
xmltoon:Insert[toon9]
xmltoon:Insert[toon10]
xmltoon:Insert[toon11]
xmltoon:Insert[toon12]
xmltoon:Insert[toon13]
xmltoon:Insert[toon14]
xmltoon:Insert[toon15]
xmltoon:Insert[toon16]
xmltoon:Insert[toon17]
xmltoon:Insert[toon18]
xmltoon:Insert[toon19]
xmltoon:Insert[toon20]

variable int Countshit

for (Countshit:Set[1] ; ${Countshit}<=20 ; Countshit:Inc)
	{
		UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT3}].FindChild[options1].FindChild[toons]:AddItem[${holyflag.FindSetting[${xmltoon[${Countshit}]}].String.Escape},${xmltoon[${Countshit}]}]
		UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT3}].FindChild[options3].FindChild[importtoons]:AddItem[${holyflag.FindSetting[${xmltoon[${Countshit}]}].String.Escape},${xmltoon[${Countshit}]}]
		UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT2}].FindChild[libfinaltoons]:AddItem[${holyflag.FindSetting[${xmltoon[${Countshit}]}].String.Escape},${xmltoon[${Countshit}]}]
		UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT2}].FindChild[libfinalrow].FindChild[libcopytoons]:AddItem[${holyflag.FindSetting[${xmltoon[${Countshit}]}].String.Escape},${xmltoon[${Countshit}]}]
		UIElement[${WINDOWELEMENT}].FindChild[${TABCONTROLELEMENT}].FindChild[${TABELEMENT}].FindChild[final].FindChild[expfinaltoons]:AddItem[${holyflag.FindSetting[${xmltoon[${Countshit}]}].String.Escape},${xmltoon[${Countshit}]}]
	}
return
}

;***********************************************************************************************************************
;Import shits to Shits Library
;***********************************************************************************************************************

function importshits()
{

	mytoon:Set[${LavishSettings[${MYSET}].FindSet[holyflag].FindSet[${tooninfo}]}]
	Declare File file "${MYMQPATH.Escape}${tooninfo}"
	File:Open(exists)

	if ${tooninfo.Equal[NULL]}
		{
		MessageBox "Please select a toon INI to import and try again.  Click OK to continue!"
		return
		}
	while ${File.EOF} != TRUE
	{
	importshit:Set[${File.Read.Escape}]
		if ${importshit.Find[shit]}
		{
			importshit2:Set[${importshit.Token[2,=].Escape}]
			echo import: ${importshit.Escape}
			echo import2: ${importshit2.Escape}
			echo sending to SAVED
			call saveimportedshits
		}
	}
	echo BAILED
	File:Close
	call removeshitlist
	call shitlist
	MessageBox "Import is complete, please click on the Library Tab and then select the toon from the upper drop down to view imported shits. Click OK to continue!" 
	return
}

function saveimportedshits()
{
LavishSettings[${MYSET}]:Import["${MYCONFIGPATH}/holyconfig.xml"]
mytoon:Set[${LavishSettings[${MYSET}].FindSet[holyflag].FindSet[${tooninfo}]}]

variable index:string xmlsaveshit
variable index:string xmlsaveshit2
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit1]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit2]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit3]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit4]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit5]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit6]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit7]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit8]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit9]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit10]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit11]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit12]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit13]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit14]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit15]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit16]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit17]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit18]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit19]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit20]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit21]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit22]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit23]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit24]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit25]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit26]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit27]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit28]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit29]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit30]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit31]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit32]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit33]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit34]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit35]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit36]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit37]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit38]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit39]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit40]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit41]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit42]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit43]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit44]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit45]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit46]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit47]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit48]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit49]}]
xmlsaveshit:Insert[${mytoon.FindSetting[savedshit50]}]
xmlsaveshit2:Insert[savedshit1]
xmlsaveshit2:Insert[savedshit2]
xmlsaveshit2:Insert[savedshit3]
xmlsaveshit2:Insert[savedshit4]
xmlsaveshit2:Insert[savedshit5]
xmlsaveshit2:Insert[savedshit6]
xmlsaveshit2:Insert[savedshit7]
xmlsaveshit2:Insert[savedshit8]
xmlsaveshit2:Insert[savedshit9]
xmlsaveshit2:Insert[savedshit10]
xmlsaveshit2:Insert[savedshit11]
xmlsaveshit2:Insert[savedshit12]
xmlsaveshit2:Insert[savedshit13]
xmlsaveshit2:Insert[savedshit14]
xmlsaveshit2:Insert[savedshit15]
xmlsaveshit2:Insert[savedshit16]
xmlsaveshit2:Insert[savedshit17]
xmlsaveshit2:Insert[savedshit18]
xmlsaveshit2:Insert[savedshit19]
xmlsaveshit2:Insert[savedshit20]
xmlsaveshit2:Insert[savedshit21]
xmlsaveshit2:Insert[savedshit22]
xmlsaveshit2:Insert[savedshit23]
xmlsaveshit2:Insert[savedshit24]
xmlsaveshit2:Insert[savedshit25]
xmlsaveshit2:Insert[savedshit26]
xmlsaveshit2:Insert[savedshit27]
xmlsaveshit2:Insert[savedshit28]
xmlsaveshit2:Insert[savedshit29]
xmlsaveshit2:Insert[savedshit30]
xmlsaveshit2:Insert[savedshit31]
xmlsaveshit2:Insert[savedshit32]
xmlsaveshit2:Insert[savedshit33]
xmlsaveshit2:Insert[savedshit34]
xmlsaveshit2:Insert[savedshit35]
xmlsaveshit2:Insert[savedshit36]
xmlsaveshit2:Insert[savedshit37]
xmlsaveshit2:Insert[savedshit38]
xmlsaveshit2:Insert[savedshit39]
xmlsaveshit2:Insert[savedshit40]
xmlsaveshit2:Insert[savedshit41]
xmlsaveshit2:Insert[savedshit42]
xmlsaveshit2:Insert[savedshit43]
xmlsaveshit2:Insert[savedshit44]
xmlsaveshit2:Insert[savedshit45]
xmlsaveshit2:Insert[savedshit46]
xmlsaveshit2:Insert[savedshit47]
xmlsaveshit2:Insert[savedshit48]
xmlsaveshit2:Insert[savedshit49]
xmlsaveshit2:Insert[savedshit50]
variable int Countshit
echo ${tooninfo}
echo SAVEDSETTINGS

for (Countshit:Set[0] ; ${Countshit}<=50 ; Countshit:Inc)
	{
		echo SAVEDSETTINGS2 ${xmlsaveshit[${Countshit}].Equal[Empty Library Slot]}
		if ${xmlsaveshit[${Countshit}].Equal[Empty Library Slot]}
		{
			echo here
			mytoon.FindSetting[${xmlsaveshit2[${Countshit}]}]:Set[${importshit2.Escape}]
			echo Wrote: ${importshit2.Escape}
			LavishSettings[${MYSET}]:Export["${MYCONFIGPATH}/holyconfig.xml"]
			call export
			call LoadSettings
			echo WRITE DONE
			LavishSettings[${MYSET}]:Import["${MYCONFIGPATH}/holyconfig.xml"]
			break
		}
	}
return
}

;***********************************************************************************************************************
;Export shit to notepad
;***********************************************************************************************************************

function dumpshit()
{
	echo this ${8piece4.Escape}
	echo this3 ${8piece6.Escape}
	if ${8piece4.Equal[""]}
	{
		MessageBox "You must select a holyshit/downshit key from the dropdown above.  Select a holyshit/downshit key and try again.  Click OK to continue!" 
		return
	}
	if ${8piece7.Equal[""]}
	{
		MessageBox "You must select a holyflag/downflag from the dropdowns above.  Select a holyflag/downflag key pair and try again.  Click OK to continue!" 
		return
	}
	if ${8piece6.Equal[""]}
	{
		MessageBox "You must select a holyflag/downflag from the dropdowns above.  Select a holyflag/downflag key pair and try again.  Click OK to continue!" 
		return
	}		
	if ${tooninfo.Equal[NULL]}
	{
		MessageBox "You must select a toon MQ2Melee.ini file from the dropdown list.  To add toon inis goto the Options tab and add them there.  Click OK to continue!" 
		return
	}
	Declare CFGFile file c:/myshit.txt
	CFGFile:Open
	CFGFile:Seek[0]
	CFGFile:Truncate
	CFGFile:Close
	wait 5

	CFGFile:Open
	CFGFile:SeekEnd
	CFGFile:Write[Cut and Paste this into your SERVERNAME_TOONNAME.ini\r\n]
	CFGFile:Write[Make sure the downshit/holyshit key number is correct or not duplicating an existing key\r\n]
	CFGFile:Write[Make sure downflag/holyflag is turned on (i.e. holyflag0\=1 downflag0\=1\, replace 0 with the shit key number) \r\n]
	CFGFile:Write[=============================================================================\r\n]
	CFGFile:Write[${8piece6}\=${8piece7}\r\n]
	CFGFile:Write[${tempshit3.Escape}\r\n]
	CFGFile:Write[=============================================================================\r\n]
	CFGFile:Close 

	wait 20
	OSExecute notepad.exe c:/myshit.txt
return
}

;***********************************************************************************************************************
;Export shits to ini
;***********************************************************************************************************************

function inishit()
{
	echo this ${8piece4.Escape}
	echo this3 ${8piece6.Escape}
	if ${8piece4.Equal[""]}
	{
		MessageBox "You must select a holyshit/downshit key from the dropdown above.  Select a holyshit/downshit key and try again.  Click OK to continue!" 
		return
	}
	if ${8piece7.Equal[""]}
	{
		MessageBox "You must select a holyflag/downflag from the dropdowns above.  Select a holyflag/downflag key pair and try again.  Click OK to continue!" 
		return
	}
	if ${8piece6.Equal[""]}
	{
		MessageBox "You must select a holyflag/downflag from the dropdowns above.  Select a holyflag/downflag key pair and try again.  Click OK to continue!" 
		return
	}		
	if ${tooninfo.Equal[NULL]}
	{
		MessageBox "You must select a toon MQ2Melee.ini file from the dropdown list.  To add toon inis goto the Options tab and add them there.  Click OK to continue!" 
		return
	}

;Search shit to find entry if not there go EOF and write new
	Declare File file "${MYMQPATH.Escape}${tooninfo}"
	File:Open(exists)
	while ${File.EOF} != TRUE
	{
	importposition:Set[${File.Position}]
	importshit:Set[${File.Read.Escape}]
		if ${importshit.Find[shit]}
		{
			importshit2:Set[${importshit.Token[1,=]}]
			echo Line: ${importposition}
			if ${importshit2.Escape.Equal[${8piece4.Escape}]}
			{
				echo Shit FOUND!
				File:Seek[${importposition}]
				File:Write[${tempshit3.Escape}\r\n]
				File:Close
				call tooninfostripchars
				call inishitflag
				return
			}
		}
	}
	if ${File.EOF} == TRUE
	{
		File:SeekEnd
		File:Write[${tempshit3.Escape}\r\n]
		echo Shit NOTFOUND
		File:Close
		call tooninfostripchars
		call inishitflag
	}
	File:Close
}
function inishitflag()
{
	Declare File file "${MYMQPATH.Escape}${tooninfo}"
	File:Open(exists)
	while ${File.EOF} != TRUE
	{
	importposition:Set[${File.Position}]
	importflag:Set[${File.Read.Escape}]
		if ${importflag.Find[flag]}
		{
			importflag2:Set[${importflag.Token[1,=].Escape}]
			if ${importflag2.Escape.Equal[${8piece6.Escape}]}
			{
				File:Seek[${importposition}]
				File:Write[${8piece6}\=${8piece7}\r\n]
				echo ${8piece6}\=${8piece7}
				echo ShitFlag WRITTEN
				File:Close
				Declare CFGFile file c:/q.cfg
				CFGFile:Open
				CFGFile:Seek[0]
				CFGFile:Truncate
				CFGFile:Close
				wait 5
				CFGFile:Open
				CFGFile:SeekEnd
				CFGFile:Write[/bct ${cleantoon3} //melee load\r\n]
				CFGFile:Write[/bct ${cleantoon3} //melee save\r\n]
				CFGFile:Close
				wait 5
				Type /loadcfg c:\\q\n
				wait 5
				MessageBox "Export complete, type "\/melee"  and verify shit entered into the INI.  Click OK to continue!" 				
				return					
			}
		}
	}
	if ${File.EOF} == TRUE
	{
		File:SeekEnd
		File:Write[${8piece6}\=${8piece7}\r\n]
		echo ${8piece6}\=${8piece7}
		File:Close
		echo ShitFlag NOTFOUND
	}	
	Declare CFGFile file c:/q.cfg
	CFGFile:Open
	CFGFile:Seek[0]
	CFGFile:Truncate
	CFGFile:Close
	wait 5
	CFGFile:Open
	CFGFile:SeekEnd
	echo went to end
	CFGFile:Write[/bct ${cleantoon3} //melee load\r\n]
	CFGFile:Write[/bct ${cleantoon3} //melee save]
	CFGFile:Close
	wait 5
	Type /loadcfg c:\\q\n
	wait 5
	MessageBox "Export complete, type "\/melee"  and verify shit entered into the INI.  Click OK to continue!" 					
	return
}

;***********************************************************************************************************************
;Toon string manipulation
;***********************************************************************************************************************

function tooninfostripchars()
{
	cleantoon:Set[${tooninfo.Token[2,_]}]
	cleantoon2:Set[${cleantoon}]
	cleantoon3:Set[${cleantoon2.Token[1,.]}]
	echo HERE: ${cleantoon3}
	return
}

;***********************************************************************************************************************
;Build Final shit from conditions
;***********************************************************************************************************************

function showshit()
{
	if ${7piece2.NotEqual[Empty]} && ${7piece3.NotEqual[Empty]} && ${7piece4.NotEqual[Empty]} && ${7piece5.NotEqual[Empty]} && ${7piece6.NotEqual[Empty]}
	{
		tempshit8:Set[\/if (${Script[shitbuilder].Variable[7piece1].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece2].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece3].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece4].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece5].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece6].Escape}) ${Script[shitbuilder].Variable[8piece1].Escape} ${Script[shitbuilder].Variable[8piece2].Escape} ${Script[shitbuilder].Variable[8piece3].Escape}]
		UIElement[expfinal@final@Builder@expbuilder@Shit Builder]:SetText[\/if (${Script[shitbuilder].Variable[7piece1].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece2].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece3].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece4].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece5].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece6].Escape}) ${Script[shitbuilder].Variable[8piece1].Escape} ${Script[shitbuilder].Variable[8piece2].Escape} ${Script[shitbuilder].Variable[8piece3].Escape}]
		echo Did 1
	}	
	if ${7piece2.NotEqual[Empty]} && ${7piece3.NotEqual[Empty]} && ${7piece4.NotEqual[Empty]} && ${7piece5.NotEqual[Empty]} && ${7piece6.Equal[Empty]}
	{
		tempshit8:Set[\/if (${Script[shitbuilder].Variable[7piece1].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece2].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece3].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece4].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece5].Escape}) ${Script[shitbuilder].Variable[8piece1].Escape} ${Script[shitbuilder].Variable[8piece2].Escape} ${Script[shitbuilder].Variable[8piece3].Escape}]
		UIElement[expfinal@final@Builder@expbuilder@Shit Builder]:SetText[\/if (${Script[shitbuilder].Variable[7piece1].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece2].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece3].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece4].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece5].Escape}) ${Script[shitbuilder].Variable[8piece1].Escape} ${Script[shitbuilder].Variable[8piece2].Escape} ${Script[shitbuilder].Variable[8piece3].Escape}]
		echo Did 2
	}	
	elseif ${7piece2.NotEqual[Empty]} && ${7piece3.NotEqual[Empty]} && ${7piece4.NotEqual[Empty]} && ${7piece5.Equal[Empty]} && ${7piece6.Equal[Empty]}
	{
		tempshit8:Set[\/if (${Script[shitbuilder].Variable[7piece1].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece2].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece3].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece4].Escape}) ${Script[shitbuilder].Variable[8piece1].Escape} ${Script[shitbuilder].Variable[8piece2].Escape} ${Script[shitbuilder].Variable[8piece3].Escape}]
		UIElement[expfinal@final@Builder@expbuilder@Shit Builder]:SetText[\/if (${Script[shitbuilder].Variable[7piece1].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece2].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece3].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece4].Escape}) ${Script[shitbuilder].Variable[8piece1].Escape} ${Script[shitbuilder].Variable[8piece2].Escape} ${Script[shitbuilder].Variable[8piece3].Escape}]
		echo Did 3
	}
	elseif ${7piece2.NotEqual[Empty]} && ${7piece3.NotEqual[Empty]} && ${7piece4.Equal[Empty]} && ${7piece5.Equal[Empty]} && ${7piece6.Equal[Empty]}
	{
		tempshit8:Set[\/if (${Script[shitbuilder].Variable[7piece1].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece2].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece3].Escape}) ${Script[shitbuilder].Variable[8piece1].Escape} ${Script[shitbuilder].Variable[8piece2].Escape} ${Script[shitbuilder].Variable[8piece3].Escape}]
		UIElement[expfinal@final@Builder@expbuilder@Shit Builder]:SetText[\/if (${Script[shitbuilder].Variable[7piece1].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece2].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece3].Escape}) ${Script[shitbuilder].Variable[8piece1].Escape} ${Script[shitbuilder].Variable[8piece2].Escape} ${Script[shitbuilder].Variable[8piece3].Escape}]
		echo Did 4
	}
	elseif ${7piece2.NotEqual[Empty]} && ${7piece3.Equal[Empty]} && ${7piece4.Equal[Empty]} && ${7piece5.Equal[Empty]} && ${7piece6.Equal[Empty]}
	{
		tempshit8:Set[\/if (${Script[shitbuilder].Variable[7piece1].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece2].Escape}) ${Script[shitbuilder].Variable[8piece1].Escape} ${Script[shitbuilder].Variable[8piece2].Escape} ${Script[shitbuilder].Variable[8piece3].Escape}]
		UIElement[expfinal@final@Builder@expbuilder@Shit Builder]:SetText[\/if (${Script[shitbuilder].Variable[7piece1].Escape} ${Script[shitbuilder].Variable[seperator].Escape} ${Script[shitbuilder].Variable[7piece2].Escape}) ${Script[shitbuilder].Variable[8piece1].Escape} ${Script[shitbuilder].Variable[8piece2].Escape} ${Script[shitbuilder].Variable[8piece3].Escape}]
		echo Did 5
	}
	elseif ${7piece2.Equal[Empty]} && ${7piece3.Equal[Empty]} && ${7piece4.Equal[Empty]} && ${7piece5.Equal[Empty]} && ${7piece6.Equal[Empty]}
	{
		MessageBox "Cannot build a one condition shit!" 
		echo Did 6
	}
}

;***********************************************************************************************************************
;Wiki search
;***********************************************************************************************************************

function websearch(string mysearch)
{
	if ${mysearch.Equal[NULL]}
	{
		wait 1
	}
	else
	{
		OSExecute http://www.macroquest2.com/wiki/index.php/Special:Search?search=${mysearch}&go=Go
	}
}

;***********************************************************************************************************************
;Check for updates, loads myupdate.iss
;***********************************************************************************************************************

function checkforupdate()
{
	Execute httpget -file "./myupdate.iss" http://dl.dropbox.com/u/4241804/Release/myupdate.iss
	wait 30
	call export
	wait 60
	run ./EQ/myupdate.iss ${cversion} ${cssbversion}
	endscript shitbuilder
}

;***********************************************************************************************************************
;Export settings to ${LavishScript.HomeDirectory}/Scripts/eq/Config/holyconfig.xml
;***********************************************************************************************************************

function export()
{
	LavishSettings[${MYSET}]:Export["${MYCONFIGPATH}/holyconfig.xml"]

	holyflag.FindSetting[MYMQPATH]:Set[${MYMQPATH.Escape}]	
	holyflag.FindSetting[toon1]:Set[${toon1.Escape}]
	holyflag.FindSetting[toon2]:Set[${toon2.Escape}]
	holyflag.FindSetting[toon3]:Set[${toon3.Escape}]
	holyflag.FindSetting[toon4]:Set[${toon4.Escape}]
	holyflag.FindSetting[toon5]:Set[${toon5.Escape}]
	holyflag.FindSetting[toon6]:Set[${toon6.Escape}]
	holyflag.FindSetting[toon7]:Set[${toon7.Escape}]
	holyflag.FindSetting[toon8]:Set[${toon8.Escape}]
	holyflag.FindSetting[toon9]:Set[${toon9.Escape}]
	holyflag.FindSetting[toon10]:Set[${toon10.Escape}]
	holyflag.FindSetting[toon11]:Set[${toon11.Escape}]
	holyflag.FindSetting[toon12]:Set[${toon12.Escape}]
	holyflag.FindSetting[toon13]:Set[${toon13.Escape}]
	holyflag.FindSetting[toon14]:Set[${toon14.Escape}]
	holyflag.FindSetting[toon15]:Set[${toon15.Escape}]
	holyflag.FindSetting[toon16]:Set[${toon16.Escape}]
	holyflag.FindSetting[toon17]:Set[${toon17.Escape}]
	holyflag.FindSetting[toon18]:Set[${toon18.Escape}]
	holyflag.FindSetting[toon19]:Set[${toon19.Escape}]
	holyflag.FindSetting[toon20]:Set[${toon20.Escape}]
	return
}

;***********************************************************************************************************************
;Function executed on window close (clicked X) export settings and unload UI
;***********************************************************************************************************************

function atexit()
{
	call export
	ui -unload "${MYUIPATH}/shitbuilder.xml"
}